//
//  ACWWalletVC.m
//  aichewang
//
//  Created by ucs on 16/2/24.
//  Copyright © 2016年 aichewang. All rights reserved.
//

#import "ACWWalletVC.h"
#import "ACWAccountsTextField.h"


@interface ACWWalletVC ()
@property (weak, nonatomic) IBOutlet UITextField *rechargeMoney;
@property (weak, nonatomic) IBOutlet UITextField *withdrawalsMoney;
@property (weak, nonatomic) IBOutlet ACWAccountsTextField *rechargeAccount;

@property (nonatomic, strong) UILabel *textLabel;
@end

@implementation ACWWalletVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.autoHiddenKeyBoardEnable = YES;
    //UIKeyboardDidShowNotification这个通知从UIWindow发出,可以获取键盘高度
    //UITextFieldTextDidBeginEditingNotification从UITextField发出,可以获取UITextField实例
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(KeyboardShowUp:) name:UITextFieldTextDidBeginEditingNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(KeyboardDismiss:) name:UITextFieldTextDidEndEditingNotification object:nil];
    
}

- (IBAction)rechargeClick {
    
}



- (void)KeyboardShowUp:(NSNotification *)notification {
    UITextField *textField = notification.object;
    if ((screenH - textField.y - textField.height) < 216) {
        [UIView animateWithDuration:0.35 delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{
            self.view.y -= 216;
        } completion:nil];
    }
}

- (void)KeyboardDismiss:(NSNotification *)notification {
    UITextField *textField = notification.object;
    if ((screenH - textField.y - textField.height) < 216) {
        [UIView animateWithDuration:0.25 delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{
            self.view.y = 0;
        } completion:nil];
    }
}





@end
